/**Copyright 2007 Ultrapower Software Co. Ltd.
 * All right reserved. 
 *
 * 2007-7-30,下午04:12:15
 */
package com.osgix.common.pojo.temp;

import java.io.Serializable;

/**
 * <b>权限点属性对象</b>
 *
 * <b>@author zqmao 2007-7-30,下午04:12:15</b>
 *
 * <b>version 1.0</b>
 */
public class Property implements Serializable {

	/**
	 * 2009-4-29,下午03:52:26
	 * @author Administrator
	 * @version 2.0
	 *
	 */
	private static final long serialVersionUID = 3382426116622809475L;

	/**
	 * 权限点ID
	 */
	private String resourceId = "";

	/**
	 * 权限点属性类型ID
	 */
	private String propertyId = "";

	/**
	 * 权限点属性的取值
	 */
	private String value = "";

	/**
	 * 权限点属性值的说明
	 */
	private String desc = "";

	/**
	 * 构造函数
	 *
	 */
	public Property() {

	}

	/**
	 * 带全参的构造函数
	 * @param resourceId
	 * @param propertyId
	 * @param value
	 * @param desc
	 */
	public Property(String resourceId, String propertyId, String value, String desc) {
		this.resourceId = resourceId;
		this.propertyId = propertyId;
		this.value = value;
		this.desc = desc;
	}

	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#clone()
	 */
	public Object clone() {
		Property newProperty = new Property(resourceId, propertyId, value, desc);
		return newProperty;
	}

	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	public boolean equals(Object obj) {
		if (obj == null || !(obj instanceof Property))
			return false;
		Property pro = (Property) obj;
		if (resourceId == null || propertyId == null)
			return false;
		if (!resourceId.equals(pro.getResourceId()))
			return false;
		if (!propertyId.equals(pro.getPropertyId()))
			return false;
		if ((value == null && pro.getValue() != null) || (value != null && !value.equals(pro.getValue())))
			return false;
		if ((desc == null && pro.getDesc() != null) || (desc != null && !desc.equals(pro.getDesc())))
			return false;
		return true;
	}

	public String toString() {
		return desc;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public String getPropertyId() {
		return propertyId;
	}

	public void setPropertyId(String propertyId) {
		this.propertyId = propertyId;
	}

	public String getResourceId() {
		return resourceId;
	}

	public void setResourceId(String resourceId) {
		this.resourceId = resourceId;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}
}
